package com.hqyj.springBoot.modules.account.controller;

import com.hqyj.springBoot.modules.common.vo.Result;
import com.hqyj.springBoot.modules.account.entity.RoleResource;
import com.hqyj.springBoot.modules.account.service.RoleResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class RoleResourceController {

    @Autowired
    private RoleResourceService roleResourceService;

    /**
     * 127.0.0.1/api/roleResource -----post
     * {"roleId":2,"resourceId":10}
     */
    @PostMapping(value = "/roleResource",consumes = MediaType.APPLICATION_JSON_VALUE)
    public Result<RoleResource> insertRoleResource(@RequestBody RoleResource roleResource){
        return roleResourceService.insertRoleResource(roleResource);
    }

}
